package cn.blb.service.edu.entity.dto;

import cn.blb.service.edu.entity.CourseDescription;
import cn.blb.service.edu.entity.Teacher;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

//@Data
//@Accessors(chain = true)
//@ApiModel(value = "CourseDto对象", description = "课程DTO")
//public class CourseDto implements Serializable {
//    private static final long seriaVersionUID = 1L;
//
//
//    @ApiModelProperty("courseID")
//    private String id;
//    @ApiModelProperty("课程讲师ID")
//    @TableField("teacher_id")
//    private String teacherId;
//
//    @ApiModelProperty("课程专业ID")
//    @TableField("subject_id")
//    private String subjectId;
//
//    @ApiModelProperty("课程专业父级ID")
//    @TableField("subject_parent_id")
//    private String subjectParentId;
//
//    @ApiModelProperty("课程标题")
//    @TableField("title")
//    private String title;
//
//    @ApiModelProperty("课程销售价格，设置为0则可免费观看")
//    @TableField("price")
//    private BigDecimal price;
//
//    @ApiModelProperty("总课时")
//    @TableField("lesson_num")
//    private Integer lessonNum;
//
//    @ApiModelProperty("课程封面图片路径")
//    @TableField("cover")
//    private String cover;
//
//    @ApiModelProperty("销售数量")
//    @TableField("buy_count")
//    private Long buyCount;
//
//    @ApiModelProperty("浏览数量")
//    @TableField("view_count")
//    private Long viewCount;
//
//    @ApiModelProperty("乐观锁")
//    @TableField("version")
//    private Long version;
//
//    @ApiModelProperty("课程状态 Draft未发布  Normal已发布")
//    @TableField("status")
//    private String status;
//
//    @ApiModelProperty("逻辑删除 1（true）已删除， 0（false）未删除")
//    @TableField("is_deleted")
//    @TableLogic
//    private Boolean deleted;
//
//    @ApiModelProperty(value = "创建时间")
//    @TableField(fill = FieldFill.INSERT)
//    private Date gmtCreate;
//
//
//    @ApiModelProperty("课程详细信息")
//    CourseDescription courseDescription;
//
//    @ApiModelProperty("subject信息")
//    String subjectOneTitle;
//
//    @ApiModelProperty("subject信息")
//    String subjectTwoTitle;
//
//    @ApiModelProperty("老师信息")
//    Teacher teacher;
//
//}
@Data
@Accessors(chain = true)
@ApiModel(value = "CourseDto对象", description = "课程DTO")
public class CourseDto implements Serializable {
    private static final long seriaVersionUID = 1L;

    //    public CourseDto(Course course) {
//        this.teacherId=course.getTeacherId();
//        this.subjectId=course.getSubjectId();
//        this.subjectParentId=course.getSubjectParentId();
//        this.title=course.getTitle();
//        this.price=course.getPrice();
//        this.lessonNum=course.getLessonNum();
//        this.cover=course.getCover();
//        this.buyCount=course.getBuyCount();
//        this.viewCount=course.getViewCount();
//        this.status=course.getStatus();
//    }
    @ApiModelProperty("老师信息")
    private Teacher teacher;
    @ApiModelProperty("courseID")
    private String id;

    @ApiModelProperty("课程讲师ID")
    @TableField("teacher_id")
    private String teacherId;

    @ApiModelProperty("课程专业ID")
    @TableField("subject_id")
    private String subjectId;

    @ApiModelProperty("课程专业父级ID")
    @TableField("subject_parent_id")
    private String subjectParentId;

    @ApiModelProperty("课程销售价格，设置为0则可免费观看")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty("总课时")
    @TableField("lesson_num")
    private Integer lessonNum;

    @ApiModelProperty("课程封面图片路径")
    @TableField("cover")
    private String cover;

    @ApiModelProperty("销售数量")
    @TableField("buy_count")
    private Long buyCount;

    @ApiModelProperty("浏览数量")
    @TableField("view_count")
    private Long viewCount;

    @ApiModelProperty("课程状态 Draft未发布  Normal已发布")
    @TableField("status")
    private String status;


    @ApiModelProperty("课程详细信息")
    private CourseDescription courseDescription;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date gmtCreate;

    @ApiModelProperty("subject信息")
    private String subjectOneTitle;

    @ApiModelProperty("subject信息")
    private String subjectTwoTitle;

    @ApiModelProperty("课程标题")
    @TableField("title")
    private String title;

    private String teacherName;


    @ApiModelProperty("课程详细信息")
    private String  description;

}